/* 
 * 统一样式指南
 * 此文件包含所有模块通用的样式，确保整个系统风格统一
 */

// 页面容器通用样式
.page-container {
  padding: 20px;
  background-color: #f5f7fa;
  min-height: 100vh;

  // 卡片通用样式
  .box-card {
    border-radius: 8px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s;

    &:hover {
      box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.15);
    }
  }

  // 卡片头部通用样式
  .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;

    .title {
      font-size: 20px;
      font-weight: bold;
      color: #303133;
      position: relative;
      padding-left: 12px;
      
      &::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 4px;
        height: 20px;
        background: linear-gradient(to bottom, #1976d2, #42a5f5);
        border-radius: 2px;
      }
    }

    .header-actions {
      display: flex;
      gap: 12px;
      
      .add-button {
        background: linear-gradient(to right, #1976d2, #42a5f5);
        border: none;
        padding: 10px 20px;
        transition: all 0.3s;
        
        &:hover {
          transform: translateY(-2px);
          box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
        }
      }
      
      .delete-button {
        background: linear-gradient(to right, #f56c6c, #f78989);
        border: none;
        padding: 10px 20px;
        transition: all 0.3s;
        
        &:hover {
          transform: translateY(-2px);
          box-shadow: 0 4px 12px rgba(245, 108, 108, 0.3);
        }
      }
    }
  }

  // 搜索区域通用样式
  .search-area {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);

    .demo-form-inline {
      display: flex;
      flex-wrap: wrap;
      gap: 15px;
      align-items: center;
    }

    .custom-input {
      width: 240px;
      
      :deep(.el-input__wrapper) {
        box-shadow: 0 0 0 1px #dcdfe6 inset;
        border-radius: 4px;
        transition: all 0.3s;
        
        &:hover, &.is-focus {
          box-shadow: 0 0 0 1px #409eff inset;
        }
      }
    }

    .search-button {
      background: linear-gradient(to right, #1976d2, #42a5f5);
      border: none;
      padding: 10px 20px;
      transition: all 0.3s;
      
      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
      }
    }
    
    .reset-button {
      border: 1px solid #dcdfe6;
      padding: 10px 20px;
      transition: all 0.3s;
      
      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        border-color: #c0c4cc;
      }
    }
  }

  // 表格通用样式
  .el-table {
    border-radius: 4px;
    overflow: hidden;
    
    :deep(th.el-table__cell) {
      background-color: #f5f7fa;
      color: #606266;
      font-weight: bold;
    }
    
    :deep(.el-table__row) {
      height: 60px;
    }
    
    :deep(.el-table__cell) {
      padding: 8px 0;
    }
    
    .operation-buttons {
      display: flex;
      justify-content: center;
      gap: 8px;
    }
    
    .view-button {
      transition: all 0.3s;
      
      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2);
      }
    }
  }

  // 分页容器通用样式
  .pagination-container {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
  }
}

// 抽屉通用样式
.custom-drawer {
  :deep(.el-drawer__header) {
    margin-bottom: 0;
    padding: 0;
    border-bottom: 1px solid #ebeef5;
  }

  .drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(to right, #1976d2, #42a5f5);
    
    .drawer-title {
      display: flex;
      align-items: center;
      gap: 10px;
      
      .title-icon {
        font-size: 20px;
        color: white;
      }
      
      span {
        font-size: 18px;
        font-weight: bold;
        color: white;
      }
    }
    
    .close-button {
      background: rgba(255, 255, 255, 0.2);
      border: none;
      color: white;
      transition: all 0.3s;
      
      &:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: rotate(90deg);
      }
    }
  }

  .drawer-content {
    padding: 30px;
  }

  .drawer-form {
    .custom-input {
      :deep(.el-input__wrapper) {
        box-shadow: 0 0 0 1px #dcdfe6 inset;
        border-radius: 4px;
        transition: all 0.3s;
        
        &:hover, &.is-focus {
          box-shadow: 0 0 0 1px #409eff inset;
        }
      }
    }

    .editor-container {
      border: 1px solid #dcdfe6;
      border-radius: 4px;
      overflow: hidden;
      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
      transition: all 0.3s;
      
      &:hover {
        box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1);
      }
    }

    .drawer-footer {
      margin-top: 40px;
      display: flex;
      justify-content: center;
      gap: 20px;

      .submit-button, .cancel-button {
        min-width: 120px;
        padding: 12px 24px;
        transition: all 0.3s;
        border-radius: 4px;
        
        &:hover {
          transform: translateY(-2px);
        }
      }

      .submit-button {
        background: linear-gradient(to right, #1976d2, #42a5f5);
        border: none;
        
        &:hover {
          box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
        }
      }
      
      .cancel-button {
        &:hover {
          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }
      }
    }
  }
}

// 弹框通用样式
.custom-dialog {
  :deep(.el-dialog__header) {
    padding: 0;
    margin: 0;
  }
  
  :deep(.el-dialog__body) {
    padding: 0;
  }
  
  :deep(.el-dialog__footer) {
    padding: 16px 20px;
    border-top: 1px solid #ebeef5;
    background-color: #f5f7fa;
  }
  
  .dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(to right, #1976d2, #42a5f5);
    
    .dialog-title {
      display: flex;
      align-items: center;
      gap: 10px;
      
      .title-icon {
        font-size: 20px;
        color: white;
      }
      
      span {
        font-size: 18px;
        font-weight: bold;
        color: white;
      }
    }
    
    .close-button {
      background: rgba(255, 255, 255, 0.2);
      border: none;
      color: white;
      transition: all 0.3s;
      
      &:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: rotate(90deg);
      }
    }
  }

  .dialog-content-wrapper {
    padding: 30px;
    background-color: #ffffff;
  }
  
  .dialog-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
    line-height: 1.8;
    
    :deep(img) {
      max-width: 100%;
      border-radius: 4px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    :deep(p) {
      margin-bottom: 16px;
    }
    
    :deep(h1), :deep(h2), :deep(h3), :deep(h4), :deep(h5), :deep(h6) {
      margin-top: 24px;
      margin-bottom: 16px;
      color: #303133;
    }
    
    :deep(table) {
      width: 100%;
      border-collapse: collapse;
      margin-bottom: 16px;
      
      th, td {
        border: 1px solid #dcdfe6;
        padding: 8px 12px;
      }
      
      th {
        background-color: #f5f7fa;
      }
    }
  }
  
  .dialog-footer {
    display: flex;
    justify-content: center;
    
    .close-dialog-button {
      min-width: 120px;
      padding: 12px 24px;
      transition: all 0.3s;
      border-radius: 4px;
      
      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      }
    }
  }
} 